# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataflow.V1b3.Model.SourceSplitResponse do
  @moduledoc """
  The response to a SourceSplitRequest.

  ## Attributes

  *   `bundles` (*type:* `list(GoogleApi.Dataflow.V1b3.Model.DerivedSource.t)`, *default:* `nil`) - If outcome is SPLITTING_HAPPENED, then this is a list of bundles into which the source was split. Otherwise this field is ignored. This list can be empty, which means the source represents an empty input.
  *   `outcome` (*type:* `String.t`, *default:* `nil`) - Indicates whether splitting happened and produced a list of bundles. If this is USE_CURRENT_SOURCE_AS_IS, the current source should be processed "as is" without splitting. "bundles" is ignored in this case. If this is SPLITTING_HAPPENED, then "bundles" contains a list of bundles into which the source was split.
  *   `shards` (*type:* `list(GoogleApi.Dataflow.V1b3.Model.SourceSplitShard.t)`, *default:* `nil`) - DEPRECATED in favor of bundles.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bundles => list(GoogleApi.Dataflow.V1b3.Model.DerivedSource.t()) | nil,
          :outcome => String.t() | nil,
          :shards => list(GoogleApi.Dataflow.V1b3.Model.SourceSplitShard.t()) | nil
        }

  field(:bundles, as: GoogleApi.Dataflow.V1b3.Model.DerivedSource, type: :list)
  field(:outcome)
  field(:shards, as: GoogleApi.Dataflow.V1b3.Model.SourceSplitShard, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Dataflow.V1b3.Model.SourceSplitResponse do
  def decode(value, options) do
    GoogleApi.Dataflow.V1b3.Model.SourceSplitResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataflow.V1b3.Model.SourceSplitResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
